home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Original Shareware 1.1
/
The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso
/
6
/
hanson.zip
/
INDE.C
< prev
next >
Wrap
Text File
|
1985-12-31
|
640b
|
35 lines
/* index and xindex for translit, and other programs */
/* find index of char c in string str */
index(str,c)
char c;
char str[];
{
int ind;
for(ind = 0; str[ind] != EOS ; ++ind)
if(str[ind] == c)
return(ind);
return(-1);
}
/* handle index specially for translit */
xindex(arr,c,allbut,lastto)
int c;
char arr[];
int allbut,lastto;
{
int index();
if(c == EOF)
return(-1);
else if(allbut == NO)
return(index(arr,(char) c));
else if(index(arr,(char) c)>-1)
return(-1);
else
return(lastto + 1);
}